{% extends "base.html" %}



{% block title %}{{ network.title }}{% endblock %}

{% block navbar_items %}
<li><a href="{% url 'pdep:index' %}">Pressure Dependent Networks</a></li>
<li><a href="{% url 'pdep:network-index' networkKey=networkKey%}">{{ network.title }}</a></li>
{% endblock %}

{% block sidebar_items %}
{% include "networkSidebar.html" %}
{% endblock %}

{% block page_title %}{{ network.title }}{% endblock %}

{% block page_body %}

{% if not network.inputFileExists %}

<div class="messagebox">
<p class="bigmessage">No input has been provided for this network.</p>
<p>You can add input by using
<a href="{% url 'pdep:network-editor' networkKey=networkKey%}">the editor</a>, or by
<a href="{% url 'pdep:network-upload' networkKey=networkKey%}">uploading a file</a>.
</p>
</div>

{% else %}

<h2>Potential Energy Surface</h2>
{% if network.surfaceFilePNGExists %}
{% if network.surfaceFilePNGOutOfDate %}
<div class="warning">
<strong>Warning:</strong> Your potential energy surface may be out of date. You may want to <a href="{% url 'pdep:network-draw-png' networkKey=networkKey %}">redraw it</a>.
</div>
{% endif %}
<p style="text-align: center;">
<a href="{{ MEDIA_URL }}pdep/networks/{{ networkKey }}/network.png"><img src="{{ MEDIA_URL }}pdep/networks/{{ networkKey }}/network.png"/></a>
</p>
{% else %}
<div class="messagebox">
<p class="bigmessage">No potential energy surface has been drawn for this network.</p>
<p>To visualize your potential energy surface, <a href="{% url 'pdep:network-draw-png' networkKey=networkKey %}">click here</a>.
</p>
</div>
{% endif %}

{% if network.inputFileExists %}
<h2>Species</h2>
<p>
<table class="networkData" cellpadding="5">
<tr>
    <th>Label</th>
    <th>Structure</th>
    <th>Type</th>
    <th>Collision model?</th>
    <th>Frequencies?</th>
    <th>Thermodynamics?</th>
</tr>
{% for label, structure, type, collision, states, thermo in speciesList %}
<tr>
    <td><a href="{% url 'pdep:network-species' networkKey=networkKey species=label %}">{{ label }}</a></td>
    <td>{{ structure|safe }}</td>
    <td>{{ type }}</td>
    <td>{{ collision }}</td>
    <td>{{ states }}</td>
    <td>{{ thermo }}</td>
</tr>
{% endfor %}
</table>
</p>

<h2>Path Reactions</h2>
<p>
<table class="networkData" cellpadding="5">
<tr>
    <th>Index</th>
    <th colspan="3">Path reaction</th>
    <th>Transition state?</th>
    <th>High-P kinetics?</th>
</tr>
{% for reactants, arrow, products, states, kinetics in pathReactionList %}
<tr>
    <td><a href="{% url 'pdep:network-path-reaction' networkKey=networkKey reaction=forloop.counter %}">{{ forloop.counter }}.</a></td>
    <td class="reactants">{{ reactants|safe }}</td>
    <td class="reactionArrow">{{ arrow|safe }}</td>
    <td class="products">{{ products|safe }}</td>
    <td>{{ states }}</td>
    <td>{{ kinetics }}</td>
</tr>
{% endfor %}
</table>
</p>

{% endif %}

{% if network.outputFileExists %}
<h2>Net Reactions</h2>
<p>
<table class="networkData" cellpadding="5">
<tr>
    <th>Index</th>
    <th colspan="3">Net reaction</th>
    <th>Kinetics?</th>
</tr>
{% for reactants, arrow, products, kinetics in netReactionList %}
<tr>
    <td><a href="{% url 'pdep:network-net-reaction' networkKey=networkKey reaction=forloop.counter %}">{{ forloop.counter }}.</a></td>
    <td class="reactants">{{ reactants|safe }}</td>
    <td class="reactionArrow">{{ arrow|safe }}</td>
    <td class="products">{{ products|safe }}</td>
    <td>{{ kinetics }}</td>
</tr>
{% endfor %}
</table>
</p>

{% endif %}

<h2>Files</h2>

{% if network.inputFileExists %}
{% include "networkFile.html" with filename="input.py" filesize=filesize.inputFile modificationTime=modificationTime.inputFile icon="img/icons/text-x-python.png" %}
<br/>
{% endif %}

{% if network.outputFileExists %}
{% include "networkFile.html" with filename="output.py" filesize=filesize.outputFile modificationTime=modificationTime.outputFile icon="img/icons/text-x-python.png" %}
<br/>
{% endif %}
{% if network.logFileExists %}
{% include "networkFile.html" with filename="arkane.log" filesize=filesize.logFile modificationTime=modificationTime.logFile icon="img/icons/text-x-generic.png" %}
<br/>
{% endif %}

{% if network.surfaceFilePNGExists %}
{% include "networkFile.html" with filename="network.png" filesize=filesize.surfaceFilePNG modificationTime=modificationTime.surfaceFilePNG icon="img/icons/image-x-generic.png" %}
<br/>
{% endif %}
{% if network.surfaceFilePDFExists %}
{% include "networkFile.html" with filename="network.pdf" filesize=filesize.surfaceFilePDF modificationTime=modificationTime.surfaceFilePDF icon="img/icons/application-pdf.png" %}
<br/>
{% endif %}
{% if network.surfaceFileSVGExists %}
{% include "networkFile.html" with filename="network.svg" filesize=filesize.surfaceFileSVG modificationTime=modificationTime.surfaceFileSVG icon="img/icons/image-svg+xml.png" %}
<br/>
{% endif %}

{% endif %}

{% endblock %}
